package com.hyt.it.ogt.kq.service.gov.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hyt.core.base.BaseServiceImpl;
import com.hyt.it.ogt.kq.service.gov.mapper.TimeSubjectPaperMapper;
import com.hyt.it.ogt.kq.service.gov.model.entity.TimeSubjectPaper;
import com.hyt.it.ogt.kq.service.gov.service.ITimeSubjectPaperService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 批次科目试卷 服务实现类
 * </p>
 *
 * @author huangyh
 * @since 2021-08-13
 */
@Service
public class TimeSubjectPaperServiceImpl extends BaseServiceImpl<TimeSubjectPaperMapper, TimeSubjectPaper> implements ITimeSubjectPaperService {

    @Override
    public void initTimeSubjectPaper(String taskId) {
        baseMapper.initTimeSubjectPaper(taskId);
    }

    @Override
    public List<TimeSubjectPaper> listByTaskId(String taskId) {
        QueryWrapper<TimeSubjectPaper> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda()
                .eq(TimeSubjectPaper::getTaskId, taskId)
                .eq(TimeSubjectPaper::getDelFlag, false);
        return list(queryWrapper);
    }

}
